package com.ssy.lingxi.member.merchant.api.feign.inner;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.api.model.vo.inner.request.*;
import com.ssy.lingxi.member.merchant.api.model.vo.inner.response.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;
import java.util.List;

/**
 * 会员等级（Level）、权益（Right）、信用（Credit）内部Feign服务接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-10-20
 */
@FeignClient(name = "merchant-member-service")
public interface MemberLevelRightCreditControllerFeign {

    /**
     * 查询平台会员的等级、权益、信用积分（多个）
     * @param memberIdList 接口参数
     * @return 平台会员的等级、权益、信用积分
     */
    @RequestMapping(value = "/member/feign/lrc/platform/getBatch", method = RequestMethod.POST)
    Wrapper<List<MemberFeignLrcVO>> getPlatformMemberLrcBatch(@RequestBody @Valid List<Long> memberIdList);

    /**
     * 查询平台会员的等级、权益、信用积分
     * @param feignVO 接口参数
     * @return 平台会员的等级、权益、信用积分
     */
    @RequestMapping(value = "/member/feign/lrc/platform/get", method = RequestMethod.POST)
    Wrapper<MemberFeignLrcVO> getPlatformMemberLrc(@RequestBody @Valid MemberFeignVO feignVO);

    /**
     * 查询下级会员的等级、权益、信用积分
     * <p> 注意：如果不是上下级会员关系，返回Null</p>
     * @param relationVO 接口参数
     * @return 下级会员在上级会员下的等级、权益、信用积分
     */
    @RequestMapping(value = "/member/feign/lrc/get", method = RequestMethod.POST)
    Wrapper<MemberFeignLrcVO> getMemberLrc(@RequestBody @Valid MemberFeignRelationVO relationVO);

    /**
     * 查询下级会员的价格权益设置
     * @param relationVO 接口参数
     * @return 下级会员在上级会员下的价格权益
     */
    @RequestMapping(value = "/member/feign/lrc/right/price/get", method = RequestMethod.POST)
    Wrapper<MemberFeignRightVO> getMemberPriceRight(@RequestBody @Valid MemberFeignRelationVO relationVO);

    /**
     * 批量查询下级会员的可用积分
     * @param batchVO 接口参数
     * @return 下级会员在上级会员下的价格权益
     */
    @RequestMapping(value = "/member/feign/lrc/right/batch/for/order", method = RequestMethod.POST)
    Wrapper<List<MemberFeignRightByOrderVO>> batchMemberPriceRightForOrder(@RequestBody @Valid MemberFeignBatchVO batchVO);

    /**
     * 批量查询下级会员的价格权益
     * @param batchVO 接口参数
     * @return 下级会员在上级会员下的价格权益
     */
    @RequestMapping(value = "/member/feign/lrc/right/price/batch", method = RequestMethod.POST)
    Wrapper<List<MemberFeignRightDetailVO>> batchMemberPriceRight(@RequestBody @Valid MemberFeignBatchVO batchVO);

    /**
     * 批量查询下级会员的价格权益
     * @param feignRelations 接口参数
     * @return 下级会员在上级会员下的价格权益
     */
    @RequestMapping(value = "/member/feign/lrc/right/price/list", method = RequestMethod.POST)
    Wrapper<List<MemberFeignRelationRightDetailVO>> batchMemberPriceRight(@RequestBody @Valid List<MemberFeignRelationVO> feignRelations);

    /**
     * 查询下级会员的返现权益设置
     * @param relationVO 接口参数
     * @return 下级会员在上级会员下的返现权益
     */
    @RequestMapping(value = "/member/feign/lrc/right/return/get", method = RequestMethod.POST)
    Wrapper<MemberFeignRightVO> getMemberReturnRight(@RequestBody @Valid MemberFeignRelationVO relationVO);

    /**
     * （批量）查询下级会员在平台后台、上级会员下的返现权益设置
     * @param relationVO 接口参数
     * @return 下级会员在上级会员下的返现权益
     */
    @RequestMapping(value = "/member/feign/lrc/right/return/find", method = RequestMethod.POST)
    Wrapper<List<MemberFeignRightDetailVO>> findMemberReturnRight(@RequestBody @Valid MemberFeignRelationVO relationVO);

    /**
     * 订单完成后，计算等级、权益、信用等信息
     * @param orderVO 接口参数
     * @return 计算结果
     */
    @RequestMapping(value = "/member/feign/lrc/calc/byorder", method = RequestMethod.POST)
    Wrapper<MemberFeignReturnRightVO> calculateMemberLrcByOrder(@RequestBody @Valid MemberFeignOrderVO orderVO);

    /**
     * 积分支付订单，校验可用信用积分、支付密码，再异步计算下级会员的权益积分
     * @param spendVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/member/feign/lrc/right/spend", method = RequestMethod.POST)
    Wrapper<Void> calculateMemberUsedRightPoint(@RequestBody @Valid MemberFeignRightSpendVO spendVO);

    /**
     * 售后评论成功后，计算会员信用积分
     * @param commentVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/member/feign/lrc/credit/aftersale", method = RequestMethod.POST)
    Wrapper<Void> calculateMemberAfterSaleCreditPoint(@RequestBody @Valid MemberFeignAfterSaleCommentVO commentVO);

    /**
     * 根据memberLevelConfigId查询会员等级配置信息
     * @param memberLevelConfigId 接口参数
     * @return 返回结果
     */
    @RequestMapping(value = "/member/feign/lrc/level/config/getBatch", method = RequestMethod.POST)
    Wrapper<List<MemberFeignLevelConfigVO>> getMemberLevelConfigBatch(@RequestBody List<Long> memberLevelConfigId);

    /**
     * 根据上级会员Id和上级会员角色Id，以及当前用户，查询价格权益参数设置
     * @param upperVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/member/feign/lrc/upper/credit/param/get", method = RequestMethod.POST)
    Wrapper<MemberFeignManageMemberCreditParameterVO> getUpperMemberCreditParameter(@RequestBody @Valid MemberFeignManageUpperMemberAndRoleVO upperVO);

    /**
     * 积分抵扣订单金额，校验可用信用积分、支付密码，扣除抵扣的积分
     * @param spendVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/member/feign/lrc/right/deduction", method = RequestMethod.POST)
    Wrapper<Void> calculateMemberDeductionRightPoint(@RequestBody @Valid MemberFeignRightDeductionVO spendVO);

    /**
     * 返还-抵扣订单金额的积分
     * @param returnVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/member/feign/lrc/right/return", method = RequestMethod.POST)
    Wrapper<Void> returnMemberRightPoint(@RequestBody @Valid MemberFeignRightReturnVO returnVO);

    /**
     * 批量查询下级会员在上级会员下的等级
     * @param feignVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/member/feign/lrc/sub/level/find", method = RequestMethod.POST)
    Wrapper<List<MemberFeignLevelDetailVO>> findSubMemberLevels(@RequestBody @Valid MemberFeignVO feignVO);
}
